#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
using namespace std;


int main() {
    string str;
    getline(cin, str);
    size_t  i = str.rfind(' ');
    size_t  ret = str.size() - i - 1;
    cout << ret;
    return 0;
}